<template>
	<view class="bg-white site_item shadow d-flex flex-column mb-2">
		<view class="flex-1 da-center px-2">
			
			<u-image width="264rpx" height="212rpx" lazy-load border-radius="6" :src="itemdata.filePath||errLoadImg" mode="scaleToFill">
				<image :src="loadingImg" style="width: 264rpx;height: 212rpx;"  slot="loading"></image>
				<image :src="errLoadImg" style="width: 264rpx;height: 212rpx;" slot="error"></image>
			</u-image>
			
			<view class="flex-1 py-3 pl-2 d-flex flex-column" style="height: 97%;">
				
				<view class="title font-md font-weight-500">{{itemdata.siteName}}</view>
				<view class="title font text-muted line-h-sm mt-auto">单位：<text class="text-dark font-weight-400 ml">{{itemdata.company}}</text></view>
				<view class="title font text-muted line-h-sm mt-auto">联系电话：<text class="text-dark font-weight-400 ml">{{itemdata.phone}}</text></view>
				<view class="title font text-muted line-h-sm mt-auto">申请时间：<text class="text-dark font-weight-400 ml">{{itemdata.createTime | dateFormat}}</text></view>
				<view class="title font text-muted line-h-sm mt-auto">处理时间：<text class="text-dark font-weight-400 ml">{{ setCompleteTime(itemdata.updateTime)}}</text></view>
				
				
			</view>
		</view>
		<view class="siteBtn flex-center" style="height: 60rpx;" v-if="itemdata.orderStatu===0">预约中</view>
		<view class="siteBtn flex-center" style="height: 60rpx;" v-else-if="itemdata.orderStatus===1" :class="{'text-success':itemdata.orderStatus===1}">预约成功</view>
		<view class="siteBtn flex-center" style="height: 60rpx;" v-else :class="{'text-warning':itemdata.orderStatus===2}">预约失败</view>
	</view>
</template>

<script>
	import { dateFormat } from '@/filter/index.js';
	export default {
		filters: {
			dateFormat
		},
		props: {
			itemdata: {
				type: Object,
				default: ()=>{}
			},
			index:{
				type:Number,
				default:()=>0
			}
		},
		data(){
			return{
				loadingImg:'/static/images/timg.gif',
				errLoadImg:'/static/images/errLoad.jpeg',
			}
		},
		computed: {
			setCompleteTime() {
				return function(time) {
					return time ? dateFormat(time) : '暂未处理';
				};
			}
		},
	}
</script>

<style scoped lang="scss">
	.site_item{
		width: 100%;
		height: 348rpx;
	}
	
	.siteBtn{
		width: 100%;
		height: 62rpx;
		border-top: 2rpx solid #DEDDE0;
		font-size: 27rpx;
		font-family: Source Han Sans CN;
		font-weight: 400;
		color: #B2090A;
	}
</style>
